<template>
  <div class="c-d">
    <el-button @click="router.go(-1)" size="default" type="primary">返回</el-button>
    <div class="c-d-i" v-for="item in courseData">
      <el-row>
        <el-col :span="24">
          课程名称：
          <el-text size="large" type="danger">
            {{item.courseName}}
          </el-text>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          课程地点：<el-text size="large" type="danger">
          {{item.venueName}}
        </el-text>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          课程教练：
          <el-text size="large" type="danger">
            {{item.coachName}}
          </el-text>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          上课时间：<el-text size="large" type="danger">
          {{item.startTime}}
        </el-text>
        </el-col>
      </el-row>
    </div>

  </div>
</template>

<script lang="ts" setup>
import {onMounted, ref} from 'vue'
import {useRouter} from "vue-router";
import {myCourseSchedule} from "@/api/coach";
const router = useRouter();

const currentDay = ref()
const courseData = ref([])

onMounted(()=>{
  currentDay.value = router.currentRoute.value.query.d
  myCourseSchedule({date: currentDay.value}).then((res)=>{
    courseData.value = res.data
  })
})
</script>

<style scoped>
  .c-d {
    color: #222222;
    padding-top: 30px;
    padding-left: 20px;
    width: 100%;
  }
  .c-d-i {
    margin-top: 30px;
    border-bottom: 1px dashed #ccc;
  }
</style>
